<?php

require_once 'BaseModel.php';

/**
 * @access public
 * @author Joana
 * @package Mapping_Dead.Mod�le
 */
class Episode extends BaseModel {

    /**
     * @AttributeType int
     */
    public $idEpisode;

    /**
     * @AttributeType int
     */
    public $idSaison;

    /**
     * @AttributeType int
     */
    public $numeroEpisode;

    /**
     * @AttributeType String
     */
    public $dateSortieEpisode;

    /**
     * @AttributeType String
     */
    public $titreEpisode;

    /**
     * @AttributeType String
     */
    public $titreEpisodeOriginal;

    /**
     * @AttributeType String
     */
    public $miniResumeEpisode;

    /**
     * @AttributeType String
     */
    public $resumeEpisode;

    /**
     * @AttributeType int
     */
    public $idSource;

    /**
     * @access public
     * @param int numeroEpisode
     * @param String resumeEpisode
     * @ParamType numeroEpisode int
     * @ParamType resumeEpisode String
     */

    public function __construct($id = null) {
        parent::__construct($id);

    }

    public function verifExiste($saisonEpisode, $numeroEpisode) {
        $args = array('idSaison'=>$saisonEpisode,'numeroEpisode'=>$numeroEpisode);
        return $this->getElement($args);
    }

    public function ajouterEpisode($saisonEpisode, $numeroEpisode, $titreEpisode, $titreEpisodeOriginal, $miniResume, $resume, $dateSortie) {
        $args = array('idSource'=>1,'idSaison'=>$saisonEpisode,'numeroEpisode'=>$numeroEpisode,'titreEpisode'=>$titreEpisode,'titreEpisodeOriginal'=>$titreEpisodeOriginal,'miniResumeEpisode'=>$miniResume,'resumeEpisode'=>$resume,'dateSortieEpisode'=>$dateSortie);
        return $this->addElement($args);
    }

    public static function afficherListeEpisode() {
        return parent::findAll();
    }

    public function getEpisode($idEpisode) {
        return $this->getById($idEpisode);
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getIdEpisode() {
        return $this->idEpisode;
    }

    /**
     * @access public
     * @param int idEpisode
     * @return void
     * @ParamType idEpisode int
     * @ReturnType void
     */
    public function setIdEpisode($idEpisode) {
        $this->idEpisode = $idEpisode;
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getIdSaison() {
        return $this->idSaison;
    }

    /**
     * @access public
     * @param int idSaison
     * @return void
     * @ParamType idSaison int
     * @ReturnType void
     */
    public function setIdSaison($idSaison) {
        $this->idSaison = $idSaison;
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getNumeroEpisode() {
        return $this->numeroEpisode;
    }

    /**
     * @access public
     * @param int numeroEpisode
     * @return void
     * @ParamType numeroEpisode int
     * @ReturnType void
     */
    public function setNumeroEpisode($numeroEpisode) {
        $this->numeroEpisode = $numeroEpisode;
    }

    /**
     * @access public
     * @return String
     * @ReturnType String
     */
    public function getResumeEpisode() {
        return $this->resumeEpisode;
    }

    public function getTitre() {
        return $this->titreEpisode;
    }

    public function getTitreOriginal() {
        return $this->titreEpisodeOriginal;
    }

    public function getMiniResume() {
        return $this->miniResumeEpisode;
    }


    public function getDateSortie() {
        return $this->dateSortieEpisode;
    }
    /**
     * @access public
     * @param String resumeEpisode
     * @return void
     * @ParamType resumeEpisode String
     * @ReturnType void
     */
    public function setResumeEpisode($resumeEpisode) {
        $this->resumeEpisode = $resumeEpisode;
    }

    /**
     * @access public
     * @param int numeroEpisode
     * @ParamType numeroEpisode int
     */
    public function sauvegarderTimeline($numeroEpisode) {
        // Not yet implemented
    }

    /**
     * @access public
     * @param String version
     * @ParamType version String
     */
    public function changerVersion($version) {
        // Not yet implemented
    }
    
    public function getAllEpisode() {
        parent::findAll();
    }
    
}

?>